﻿using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.Security;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using KeRui.Common;
using System.Collections.Generic;

public partial class Manage_Member_GroupList : System.Web.UI.Page
{
    public List<KeRui.Model.MemberGroup> list;
    protected void Page_Load(object sender, EventArgs e)
    {
        KeRui.BLL.MemberGroup bll = new KeRui.BLL.MemberGroup();
        list = bll.GetList();
    }

    public string MemberGroupLevelImage(int level)
    {
        string img = "";
        int s3 = (int)level / 4;//有多少个3星
        int y = level % 4;//剩余星星

        for (int i=0; i < s3; i++)
        {
            img += ",3";
        }

        if (y == 1)
            img += ",1";
        else if (y == 2)
            img += ",2";
        else if (y == 3)
            img += ",2,1";

        string[] pic = Utils.SplitString(img,",");
        string ret = "";
        for (int i = 1; i < pic.Length; i++)
        {
            ret += "<img align='absmiddle' src='../pic/icons/user/star_level" + pic[i] + ".gif'>";
        }

        return ret.ToString();
    }
}
